package hanshet;

import java.util.HashSet;
import java.util.Set;

public class Demo1 {
    public static void main(String[] args) {
        Set<Student>set = new HashSet<>();
        Student  s1 = new Student("xiaogou",18);
        Student  s2 = new Student("zhangsang",28);
        Student  s3 = new Student("xiaogou",18);
        Student  s4 = new Student("lisi",38);
        set.add(s1);
        set.add(s2);
        set.add(s3);
        set.add(s4);
        for (Student student : set) {
            System.out.println(student);
        }
    }
}
